﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Indie_Game_Contest
{
    //public enum TilesSet { SINGLE, ARCH, BG_ARCH, BG_LEFT, BG_RIGHT, BG_PLANTSMALL, BG_PLANTBIG, MOON };

    class Tile : CBaseObject
    {

        //enum Tile
        //////////////////////////////////////////////////////////////////////////
        // Data Members
        Rectangle rect;
        private int m_nCurrentTile;

        //////////////////////////////////////////////////////////////////////////
        // Methods
        public Tile()
        {
            type = ObjectType.Tile;
        }
        public override void Render()
        {
            WorldData.spriteBatch.Draw(TextureManager.Instance.GetTexture(textureID),position,SrcRect,
                colorMask,rotation,center,scale,SpriteEffects.None,0);
        }
        public override void Update(float dt)
        {
        }

        public override CollisionSide CheckCollision(CBaseObject obj)
        {
            return base.CheckCollision(obj);
        }

        public override void LoadContent(Rectangle sourceRect, Vector2 vPos, Color mask, Texture2D tImage, float fRotation, float fScale, int nWidth, int nHeight, int nID)
        {
            SrcRect         = sourceRect;
            Position        = vPos;
            ColorMask       = mask;
            Image           = tImage;
            Rotation        = fRotation;
            Scale           = fScale;
            Width           = nWidth;
            Height          = nHeight;
            center          = new Vector2(width / 2, height / 2);
            TextureID       = nID;
        }

        //////////////////////////////////////////////////////////////////////////
        // Properties
        public Microsoft.Xna.Framework.Rectangle Rect
        {
            get { return rect; }
            set { rect = value; }
        }

        public int NCurrentTile
        {
            get { return m_nCurrentTile; }
            set { m_nCurrentTile = value; }
        }
    }
}
